#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int n = 0;
	scanf("%d", &n);
	char arr[14] = { 0 };
	int i = 0;
	int k = 0;
	while (n)
	{
		if (k != 0 && k % 3 == 0)
		{
			arr[i++] =',';
		}
		arr[i++] = n % 10 + '0';
		n /= 10;
		k++;
	}
	int j = 0;
	for (j = i - 1; j >= 0; j--)
	{
		printf("%c", arr[j]);
	}
	return 0;
}